using System.Collections;
using System.Collections.Generic;
using SUIFW;
using UnityEngine;

public class CanvasMain : BaseUIForm
{
   public void Awake()
   {
      //为默认值时，可以不写
      base.CurrentUIType.UIForms_Type = UIFormType.Normal;
      base.CurrentUIType.UIForms_ShowMode = UIFormShowMode.Normal;
      base.CurrentUIType.UIForms_LucencyType = UIFormLucencyType.Lucency;
      
      //给按钮注册事件
      //查找按钮节点
      RegisterButtonObjectEvent("Button-Romance", p =>
      {
          OpenUIForm("CanvasStatic");
          OpenUIForm("RomancePanel");
          CloseUIForm();
      });
     RegisterButtonObjectEvent("Button-Hegemony",LogonSys);
     RegisterButtonObjectEvent("Button-Governance", p =>
     {
         OpenUIForm("CanvasStatic");
         OpenUIForm("GovernancePanel");
         CloseUIForm();
     });
     RegisterButtonObjectEvent("Button-Military", p =>
     {
         OpenUIForm("CanvasStatic");
         OpenUIForm("MilitaryPanel");
         CloseUIForm();
     });
     RegisterButtonObjectEvent("Button-Activities",LogonSys);
     
     
     RegisterButtonObjectEvent("Button-Save", p =>
     {
         OpenUIForm("SavePopUp");
     });
     RegisterButtonObjectEvent("Button-Language",p =>
     {
         OpenUIForm("LanguagePopUp");
     });
     RegisterButtonObjectEvent("Button-About",LogonSys);
     RegisterButtonObjectEvent("Button-Config",p =>
     {
         OpenUIForm("ConfigPopUp");
     });
   }

   private void LogonSys(GameObject go)
   {
       Debug.Log(go.name);
   }
   
}
